package cn.exempale.mscapplication.viewModel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import java.util.List;

import cn.exempale.mscapplication.dto.TaskDTO;
import cn.exempale.mscapplication.model.net.callback.Resource;
import cn.exempale.mscapplication.model.repository.NormalRepository;
import cn.exempale.mscapplication.utils.JsonUtils;
import cn.exempale.mscapplication.vo.ResultVO;

public class ResultViewModel extends AndroidViewModel {

    private NormalRepository normalRepository;

    public ResultViewModel(@NonNull Application application) {
        super(application);
        this.normalRepository = NormalRepository.newInstance();
    }

    public Resource<List<ResultVO>> getResult(TaskDTO taskDTO){
        return normalRepository.getResult(JsonUtils.Obj2Map(taskDTO));
    }

}
